<form action="<?php e_qus(); ?>" method="get">
    <fieldset>
        <legend></legend>
        <label for="orderState"></label>
        <select name="state" id="orderState">
            <option value="" >所有</option>
            <?php foreach($r['orderState'] as $k=>$v){ ?>
                <option value="<?=$k?>" <?php if($k==$r['currentState']) echo "selected";?>><?=$v?></option>
            <?php } ?>
        </select>
        <input type="submit" value="搜 索"/><br/><br/>
    </fieldset>
</form>
<table id="dataTable">
    <thead>
    <tr>
        <th>ID</th>
        <th>当前状态</th>
        <th>下单/支付时间</th>
        <th>使用时间</th>
        <th>价格</th>
        <th>操作</th>
    </tr>
    </thead>
    <tbody>
    <?php foreach($r['list'] as $v){?>
        <tr>
            <td><?php echo $v['id'];?></td>
            <td><?=$r['orderState'][$v['state']]; ?></td>
            <td>
                <?php if(!empty($v['payment_time'])){ ?>
                    <?=$v['payment_time']?>
                <?php }elseif($v['state']=="unpaid"){ ?>
                    <a href="<?php e_action("dealUrgePay","order_id=".$v['id'])?>">催促付款</a>
                    <a href="<?php e_action("dealClose","order_id=".$v['id'])?>">关闭订单</a>
                <?php } ?>
            </td>
            <td>
                <?php if(!empty($v['deal_time'])){ ?>
                    <?=$v['deal_time']?>
                <?php } ?>
            </td>
            <td>￥<?php echo $v['order_amount'];?></td>
            <td><a href="<?php e_action("detail","id={$v['id']}")?>">查看对应订单</a></td>
        </tr>
    <?php } ?>
    </tbody>
</table>
<?php echo $r['page']->getPageHtml(); ?>